--[[
 -- *名称:HelpLayer
 -- *描述:房间内玩法弹框
 -- *版权:Copyright © 2016-2018 深圳市三只小熊科技有限公司 版权所有
 -- *作者:Terry
 -- *创建日期:2017-10-16
 -- *修改日期:2017-10-16
 ]]
local CURRENT_MODULE_NAME = ...
local HelpLayer = class("HelpLayer",PokerViewBase)


--[[
 界面处理需要保证就算是错误数据也做到不崩溃
 在获取到数据的时候进行checkData操作
]]
function HelpLayer:onCreate()
     self:initWithFilePath("helplayer", CURRENT_MODULE_NAME);

     self:_initialize();
end

function HelpLayer:_initialize(  )
	self._bgMask = self.node.bg_mask;
	self._bgFrame = self.node.bg_frame;
	self._btnClose = self.node.btn_close;

	-- self._bgMask:addTouchEventListener(handler(self, self.onBgMaskTouch));
	self._btnClose:addClickEventListener(handler(self, self.onBtnCloseClick));
    
    local config = import(".helpcontent", CURRENT_MODULE_NAME);
    self._txtContent = self.node.Text_1;
    -- self._txtContent:setContentSize(cc.size(config.width, config.height));
    self._txtContent:setString(config.content);
	self:hideView();
end

function HelpLayer:onBgMaskTouch(  )
	self:hideView();
end

--返回键事件
function HelpLayer:backEvent()
	self:hideView();
	HelpLayer.super.backEvent(self);
end

function HelpLayer:showView(  )
	self:show();
	self._bgMask:show();
	self._bgFrame:show();	
	
	local scale = display.width / 1280;
	self._bgFrame:setScale(scale);
	AnimUtils.playPopupAnim(self._bgFrame);
end

function HelpLayer:hideView(  )
	self:hide();
end

function HelpLayer:onBtnCloseClick(  )
	SoundMgr.ClickButton();
	self:hide();
end

return HelpLayer